﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Small.Html.Options
{
   public class JqGridEvent:JqBase
    {

       List<string> list = new List<string>();
        private string beforeSelectRow ;

        public string BeforeSelectRow
        {
            get { return beforeSelectRow; }
            set { beforeSelectRow = value;
            list.Add(Event("beforeSelectRow", beforeSelectRow));
            }
        }
        private string onSelectRow ;


        private string onCellSelect;
       /// <summary>
       /// 此事件在点击表格特定单元格时发生,rowid 为行ID；iCol 为列索引,cellcontent 为单元格中内容,e 点击事件对象。
       /// </summary>
        public string OnCellSelect
        {
            get { return onCellSelect; }
            set { onCellSelect = value;
            list.Add(Event("OnCellSelect", OnCellSelect));
            }
        }

        public string OnSelectRow
        {
            get { return onSelectRow; }
            set { onSelectRow = value;
            list.Add(Event("onSelectRow", onSelectRow));
            }
        }
        private string onSortCol ;

        public string OnSortCol1
        {
            get { return onSortCol; }
            set { onSortCol = value;
            list.Add(Event("onSortCol", onSortCol));
            }
        }


        private string ondblClickRow ;

       /// <summary>
       /// 此事件发生在行双击后发生。
       ///rowid为行ID；iRow 为行索引（勿与rowid混淆）；
       ////iCol为列索引；
       ////e 为事件对象。
       /// </summary>
        public string OndblClickRow
        {
            get { return ondblClickRow; }
            set { ondblClickRow = value;
            list.Add(Event("ondblClickRow", ondblClickRow));
            }
        }


        private string onRightClickRow ;

        

        public string OnRightClickRow
        {
            get { return onRightClickRow; }
            set { onRightClickRow = value;

            list.Add(Event("onRightClickRow", onRightClickRow));
            }
        }
        private string onPaging ;


        public string OnPaging
        {
            get { return onPaging; }
            set { onPaging = value;

            list.Add(Event("onPaging", onPaging));
            }
        }
        private string onSelectAll ;

       /// <summary>
       /// aRowids,status
       /// </summary>
        public string OnSelectAll
        {
            get { return onSelectAll; }
            set { onSelectAll = value;
            list.Add(Event("onSelectAll", onSelectAll));
            }
        }
        private string onInitGrid ;

        public string OnInitGrid
        {
            get { return onInitGrid; }
            set { onInitGrid = value;
            list.Add(Event("onInitGrid", onInitGrid));
            }
        }
        private string loadComplete ;

        public string LoadComplete
        {
            get { return loadComplete; }
            set { loadComplete = value;
            list.Add(Event("loadComplete", loadComplete));
            }
        }
        private string gridComplete ;

        public string GridComplete
        {
            get { return gridComplete; }
            set { gridComplete = value;
            list.Add(Event("gridComplete", gridComplete));
            }
        }
        private string loadError ;

        public string LoadError
        {
            get { return loadError; }
            set { loadError = value;
            list.Add(Event("loadError", loadError));
            }
        }
        private string loadBeforeSend ;

        public string LoadBeforeSend
        {
            get { return loadBeforeSend; }
            set { loadBeforeSend = value;
            list.Add(Event("loadBeforeSend", loadBeforeSend));
            }
        }
        private string afterInsertRow ;

        public string AfterInsertRow
        {
            get { return afterInsertRow; }
            set { afterInsertRow = value;
            list.Add(Event("afterInsertRow", afterInsertRow));
            }
        }
        private string beforeRequest ;

        public string BeforeRequest
        {
            get { return beforeRequest; }
            set { beforeRequest = value;
            list.Add(Event("beforeRequest", beforeRequest));
            }
        }
        private string beforeProcessing ;

        public string BeforeProcessing
        {
            get { return beforeProcessing; }
            set { beforeProcessing = value;
            list.Add(Event("beforeProcessing", beforeProcessing));
            }
        }
        private string onHeaderClick ;

        public string OnHeaderClick
        {
            get { return onHeaderClick; }
            set { onHeaderClick = value;
            list.Add(Event("onHeaderClick", onHeaderClick));
            }
        }

       /// <summary>
       /// data
       /// </summary>
        private string serializeGridData;

        public string SerializeGridData
        {
            get { return serializeGridData; }
            set { serializeGridData = value;
            list.Add(Event("serializeGridData", serializeGridData));
            }
        }

        private string resizeStart;

        public string ResizeStart
        {
            get { return resizeStart; }
            set { resizeStart = value;
            list.Add(Event("resizeStart", resizeStart));
            }
        }
        private string resizeStop;

        public string ResizeStop
        {
            get { return resizeStop; }
            set { resizeStop = value;
            list.Add(Event("resizeStop", resizeStop));
            }
        }

        public override string GenerateString()
        {
            return string.Join("," + Environment.NewLine, list.ToArray());
        }
    }
}
